home *** CD-ROM | disk | FTP | other *** search
/ .net 1999 December / netCD65.iso / mac / madasafish / macsw / Internet Setup / Modem Scripts / Supra 56 for PowerMac / Supra 56 for PowerMac
Encoding:
Text File  |  1998-05-27  |  12.5 KB  |  684 lines  |  [mlts/slnk]

  1. !  Supra 56k V.90
  2. !    Author:    Kris Kreutzman
  3. !
  4. !    Copyright:    © 1991-1996 Apple Computer, Inc.    All Rights Reserved.
  5. !
  6. !    revision history:
  7. !        v2.1    as shipped with the ARA 2.1
  8. !
  9. !  'mlts' resource info for this modem:
  10. !    byte 1 == 01 -> modem HAS built-in error correction protocols
  11. !    byte 2 == 01 -> modem HAS built-in data compression protocols
  12. !    byte 3 == 40 -> max number of chars in varstr 7
  13. !    byte 4 == 40 -> max number of chars in varstr 8
  14. !    byte 5 == 40 -> max number of chars in varstr 9
  15. !    
  16. !    
  17. !    Changes Copyright:    © 1998 Diamond Multimedia    All Rights Reserved.
  18. !
  19. !    revision history:
  20. !        v2.1D    to accomodate 56k connections
  21. !
  22. !        Set DTE to 115200 BPS
  23. !        Added result codes 32000 - 54000 (Label 110-120)
  24. !        Omitted code 48000 (already included as Label 55)
  25. !        Relabeled Label 59 as: Connection Established
  26. !        Changed Label 98 to initialize with &F1
  27. !        Corrected spelling in Label 3 & 27 "Response"
  28. !        Removed addition of Calling Tone (\^) at Label 15 & 19
  29. !        Added result codes for V.90 compatibility (Label 73-79, 83-89)
  30. !        Added "L" to init string for volume adjustment
  31. !
  32. @ORIGINATE
  33. @ANSWER
  34. !
  35. ! ---- Initial modem setup ----
  36. !
  37. ! Set serial port speed depending upon the compression flag
  38. !    A higher rate with compression on to handle expanded data from the modem
  39. !    A lower rate closer to the DCE when compression is off
  40. ifstr 5 1 "0"
  41. serreset 115200, 0, 8, 1
  42. jump 2
  43. !
  44. @LABEL 1
  45. serreset 38400, 0, 8, 1
  46. !
  47. @LABEL 2
  48. hsreset 0 0 0 0 0 0
  49. settries 0
  50. !
  51. ! Get the modem's attention
  52. !
  53. matchclr
  54. matchstr 1 3 "OK\13\10"
  55. write "AT\13"
  56. matchread 30
  57. !
  58. @LABEL 3
  59. !
  60. ! Setup the modem for the following:
  61. !   Reset to factory settings
  62. !   Standard compression/reliablity
  63. !   Lock serial port speed
  64. !   Serial port hardware handshaking, turn off software handshaking
  65. !   Verbose responses and compression/protocol results
  66. !   CONNECT returns DCE speed
  67. !   Turn off answering
  68. !   Reset or return to command mode on DTR toggle (optional)
  69. !
  70. matchclr
  71. matchstr 1 4   "OK\13\10"
  72. matchstr 2 101 "ERROR\13\10"
  73. write "AT&F1L&C1&D2W2E0S7=150\13"
  74. matchread 30
  75. inctries
  76. iftries 3 101
  77. !
  78. ! Reset the Modem on setup failure
  79. !
  80. DTRClear
  81. pause 5
  82. DTRSet
  83. flush
  84. jump 3
  85. !
  86. !
  87. @LABEL 4
  88. ! Varstring 4 , reliable link protocol:
  89. !    = 0, handled by computer (ARAP)
  90. !    = 1, handled by modem (PPP)
  91. !    = 2, MNP10 protocol (Cellular protocol, no longer supported)
  92. ifstr 4 5 "1"
  93. ifstr 4 5 "2"
  94. !
  95. ! Varstring 4 == 0, turn off reliable link protocol in modem (ARAP)
  96. matchclr
  97. matchstr 1 9 "OK\13\10"
  98. write "AT\\N0\13"
  99. matchread 30
  100. jump 101
  101. !
  102. !
  103. @LABEL 5
  104. ! Varstring 5, compression protocol:
  105. !    = 0, handled by computer 
  106. !    = 1, handled by modem
  107. ifstr 5 9 "1"
  108. !
  109. ! Varstring 5 == 0, turn off compression protocol in modem.
  110. matchclr
  111. matchstr 1 9 "OK\13\10"
  112. write "AT%C0\13"
  113. matchread 30
  114. jump 101
  115. !
  116. !
  117. @LABEL 9
  118. ! Varstring 2, modem speaker:
  119. !    = 0, speaker off
  120. !    = 1, speaker on
  121. ifstr 2 13 "1"
  122. pause 5
  123. matchclr
  124. matchstr 1 13 "OK\13\10"
  125. write "ATM0\13"
  126. matchread 30
  127. jump 101
  128. !
  129. ! Modem ready, wait for a call or originate a call
  130. !
  131. @LABEL 13
  132. ifANSWER 32
  133. !
  134. !
  135. ! ---- Originating a call ----
  136. !
  137. ! Varstring 6, dialing mode:
  138. !    = 0, normal dialing
  139. !    = 1, blind dialing
  140. !    = 2, manual dialing
  141. ifstr 6 17 "1"
  142. ifstr 6 15 "2"
  143. jump 19
  144. !
  145. @LABEL 15
  146. ! Display ASK dialog with message.  Goto label 107 if dialog canceled.
  147. ASK 2 "Pick up the phone & dial ^1.  Hit OK when the phone rings, then hangup." 107
  148. note "Manual dialing initiated" 3
  149. ! X1 to ignore dialtone & busy, D to dial, \^ for data tone
  150. !    (\^ removed with v2.1D)
  151. write "ATX1D\13"
  152. jump 32
  153. !
  154. @LABEL 17
  155. note "Dialing without tone" 3
  156. matchclr
  157. matchstr 1 19 "OK\13\10"
  158. ! X1 to ignore dialtone & busy
  159. write "ATX1\13"
  160. matchread 30
  161. jump 101
  162. !
  163. !
  164. @LABEL 19
  165. ! Display the full dialstring contained in Varstring 1
  166. note "Dialing ^1" 3
  167. !
  168. ! Varstrings 7, 8 and 9, contain dialstring fragments
  169. !    Long phone numbers may need to be split into smaller groups
  170. !    for the modem to use
  171. !
  172. ! Varstring 3:  "p" for pulse & "t" for tone dialing
  173. ! Varstring 8 == blank (dialstring in varstring 7)
  174. ! Varstring 9 == blank (dialstring in varstrings 7 & 8)
  175. ! Otherwise (dialstring in varstrings 7, 8 & 9)
  176. ! \^ is added to the dialstring to force the modem to generate a data tone
  177. !    (removed with v2.1D)
  178. ifstr 8 27 " "
  179. ifstr 9 24 " "
  180. !
  181. !  Write dialstring in varstrings 7, 8 & 9
  182. matchclr
  183. matchstr 1 21 "OK\13\10"
  184. write "ATD^3^7;\13"
  185. matchread 400
  186. jump 101
  187.  
  188. @LABEL 21
  189. matchclr
  190. matchstr 1 22 "OK\13\10"
  191. write "ATD^3^8;\13"
  192. matchread 400
  193. jump 101
  194.  
  195. @LABEL 22
  196. write "ATD^3^9\13"
  197. jump 32
  198. !
  199. !
  200. @LABEL 24
  201. !  Write dialstring in varstrings 7 & 8
  202. matchclr
  203. matchstr 1 25 "OK\13\10"
  204. write "ATD^3\^^7;\13"
  205. matchread 400
  206. jump 101
  207.  
  208. @LABEL 25
  209. write "ATD^3^8\13"
  210. jump 32
  211. !
  212. @LABEL 27
  213. !  Write dialstring in varstring 7
  214. write "ATD^3\^^7\13"
  215. !
  216. !
  217. !    ---- Connection response ----
  218. !
  219. ! The following section will parse modem responses of two types:
  220. !   1) PROTOCOL: xxx, COMPRESSION: xxx, CONNECT xxx
  221. !   2) CONNECT xxx/ARQ/V42
  222. !
  223. @LABEL 32
  224. matchclr
  225. matchstr  1 81  "RING\13\10"
  226. matchstr  2 102 "NO DIALTONE\13\10"
  227. matchstr  3 103 "NO CARRIER"
  228. matchstr  4 103 "ERROR\13\10"
  229. matchstr  5 104 "BUSY\13\10"
  230. matchstr  6 105 "NO ANSWER\13\10"
  231. matchstr  7 33  "CONNECT "
  232. matchstr  8 32  "CARRIER"
  233. matchstr  9 40  "CONNECT\13\10"
  234. matchstr 10 62  "PROTOCOL: LAP"
  235. matchstr 11 62  "PROTOCOL: MNP"
  236. matchstr 12 62  "PROTOCOL: ALT"
  237. matchstr 13 67  "COMPRESSION: V"
  238. matchstr 14 67  "COMPRESSION: MNP5"
  239. matchstr 15 67  "COMPRESSION: CLASS"
  240. matchread 700
  241. ifANSWER 32
  242. jump 101
  243. !
  244. !  Parse the speed of connect result codes
  245. !  2400 and 4800 have two entries each
  246. !  to distinguish them from 24000 and 48000
  247. !
  248. @LABEL 33
  249. matchclr
  250. matchstr  1 40 "2400\13"
  251. matchstr  2 40 "2400/"
  252. matchstr  3 41 "4800\13"
  253. matchstr  4 41 "4800/"
  254. matchstr  5 42 "7200"
  255. matchstr  6 43 "9600"
  256. matchstr  7 44 "12000"
  257. matchstr  8 45 "14400"
  258. matchstr  9 46 "16800"
  259. matchstr 10 47 "19200"
  260. matchstr 11 48 "21600"
  261. matchstr 12 49 "24000"
  262. matchstr 13 50 "26400"
  263. matchstr 14 51 "28800"
  264. matchstr 15 52 "31200"
  265. matchstr 16 53 "33600"
  266. matchstr 17 54 "38400"
  267. matchstr 18 55 "48000"
  268. matchstr 19 56 "56000"
  269. matchstr 20 57 "57600"
  270. matchstr 21 58 "64000"
  271. matchstr 22 110 "32000"
  272. matchstr 23 111 "34000"
  273. matchstr 24 112 "36000"
  274. matchstr 25 113 "38000"
  275. matchstr 26 114 "40000"
  276. matchstr 27 115 "42000"
  277. matchstr 28 116 "44000"
  278. matchstr 29 117 "46000"
  279. matchstr 30 118 "50000"
  280. matchstr 31 119 "52000"
  281. matchstr 32 120 "54000"
  282. matchstr 33 73 "2933"
  283. matchstr 34 74 "3066"
  284. matchstr 35 75 "3333"
  285. matchstr 36 76 "3466"
  286. matchstr 37 77 "3733"
  287. matchstr 38 78 "3866"
  288. matchstr 39 79 "4133"
  289. matchstr 40 83 "4266"
  290. matchstr 41 84 "4533"
  291. matchstr 42 85 "4666"
  292. matchstr 43 86 "4933"
  293. matchstr 44 87 "5066"
  294. matchstr 45 88 "5333"
  295. matchstr 46 89 "5466"
  296. matchread 30
  297. jump 59
  298. !
  299. ! -- Connection rates --
  300. ! CommunicatingAt informs ARA of the raw modem to modem
  301. ! connection speed.
  302. !
  303. @LABEL 40
  304. note "Communicating at 2400 bps." 2
  305. CommunicatingAt 2400
  306. jump 60
  307. !
  308. @LABEL 41
  309. note "Communicating at 4800 bps." 2
  310. CommunicatingAt 4800
  311. jump 60
  312. !
  313. @LABEL 42
  314. note "Communicating at 7200 bps." 2
  315. CommunicatingAt 7200
  316. jump 60
  317. !
  318. @LABEL 43
  319. note "Communicating at 9600 bps." 2
  320. CommunicatingAt 9600
  321. jump 60
  322. !
  323. @LABEL 44
  324. note "Communicating at 12400 bps." 2
  325. CommunicatingAt 12400
  326. jump 60
  327. !
  328. @LABEL 45
  329. note "Communicating at 14400 bps." 2
  330. CommunicatingAt 14400
  331. jump 60
  332. !
  333. @LABEL 46
  334. note "Communicating at 16800 bps." 2
  335. CommunicatingAt 16800
  336. jump 60
  337. !
  338. @LABEL 47
  339. note "Communicating at 19200 bps." 2
  340. CommunicatingAt 19200
  341. jump 60
  342. !
  343. @LABEL 48
  344. note "Communicating at 21600 bps." 2
  345. CommunicatingAt 21600
  346. jump 60
  347. !
  348. @LABEL 49
  349. note "Communicating at 24000 bps." 2
  350. CommunicatingAt 24000
  351. jump 60
  352. !
  353. @LABEL 50
  354. note "Communicating at 26400 bps." 2
  355. CommunicatingAt 26400
  356. jump 60
  357. !
  358. @LABEL 51
  359. note "Communicating at 28800 bps." 2
  360. CommunicatingAt 28800
  361. jump 60
  362. !
  363. @LABEL 52
  364. note "Communicating at 31200 bps." 2
  365. CommunicatingAt 31200
  366. jump 60
  367. !
  368. @LABEL 53
  369. note "Communicating at 33600 bps." 2
  370. CommunicatingAt 33600
  371. jump 60
  372. !
  373. @LABEL 54
  374. note "Communicating at 38400 bps." 2
  375. CommunicatingAt 38400
  376. jump 60
  377. !
  378. @LABEL 55
  379. note "Communicating at 48000 bps." 2
  380. CommunicatingAt 48000
  381. jump 60
  382. !
  383. @LABEL 56
  384. note "Communicating at 56000 bps." 2
  385. CommunicatingAt 56000
  386. jump 60
  387. !
  388. @LABEL 57
  389. note "Communicating at 57600 bps." 2
  390. CommunicatingAt 57600
  391. jump 60
  392. !
  393. @LABEL 58
  394. note "Communicating at 64000 bps." 2
  395. CommunicatingAt 64000
  396. jump 60
  397. !
  398. @LABEL 110
  399. note "Communicating at 32000 bps." 2
  400. CommunicatingAt 32000
  401. jump 60
  402. @LABEL 111
  403. note "Communicating at 34000 bps." 2
  404. CommunicatingAt 34000
  405. jump 60
  406. @LABEL 112
  407. note "Communicating at 36000 bps." 2
  408. CommunicatingAt 36000
  409. jump 60
  410. @LABEL 113
  411. note "Communicating at 38000 bps." 2
  412. CommunicatingAt 38000
  413. jump 60
  414. @LABEL 114
  415. note "Communicating at 40000 bps." 2
  416. CommunicatingAt 40000
  417. jump 60
  418. @LABEL 115
  419. note "Communicating at 42000 bps." 2
  420. CommunicatingAt 42000
  421. jump 60
  422. @LABEL 116
  423. note "Communicating at 44000 bps." 2
  424. CommunicatingAt 44000
  425. jump 60
  426. @LABEL 117
  427. note "Communicating at 46000 bps." 2
  428. CommunicatingAt 46000
  429. jump 60
  430. !
  431. @LABEL 118
  432. note "Communicating at 50000 bps." 2
  433. CommunicatingAt 50000
  434. jump 60
  435. @LABEL 119
  436. note "Communicating at 52000 bps." 2
  437. CommunicatingAt 52000
  438. jump 60
  439. @LABEL 120
  440. note "Communicating at 54000 bps." 2
  441. CommunicatingAt 54000
  442. jump 60
  443. @LABEL 73
  444. note "Communicating at 29333 bps." 2
  445. CommunicatingAt 29333
  446. jump 60
  447. @LABEL 74
  448. note "Communicating at 30666 bps." 2
  449. CommunicatingAt 30666
  450. jump 60
  451. @LABEL 75
  452. note "Communicating at 33333 bps." 2
  453. CommunicatingAt 33333
  454. jump 60
  455. @LABEL 76
  456. note "Communicating at 34666 bps." 2
  457. CommunicatingAt 34666
  458. jump 60
  459. @LABEL 77
  460. note "Communicating at 37333 bps." 2
  461. CommunicatingAt 37333
  462. jump 60
  463. @LABEL 78
  464. note "Communicating at 38666 bps." 2
  465. CommunicatingAt 38666
  466. jump 60
  467. @LABEL 79
  468. note "Communicating at 41333 bps." 2
  469. CommunicatingAt 41333
  470. jump 60
  471. @LABEL 83
  472. note "Communicating at 42666 bps." 2
  473. CommunicatingAt 42666
  474. jump 60
  475. @LABEL 84
  476. note "Communicating at 45333 bps." 2
  477. CommunicatingAt 45333
  478. jump 60
  479. @LABEL 85
  480. note "Communicating at 46666 bps." 2
  481. CommunicatingAt 46666
  482. jump 60
  483. @LABEL 86
  484. note "Communicating at 49333 bps." 2
  485. CommunicatingAt 49333
  486. jump 60
  487. @LABEL 87
  488. note "Communicating at 50666 bps." 2
  489. CommunicatingAt 50666
  490. jump 60
  491. @LABEL 88
  492. note "Communicating at 53333 bps." 2
  493. CommunicatingAt 53333
  494. jump 60
  495. @LABEL 89
  496. note "Communicating at 54666 bps." 2
  497. CommunicatingAt 54666
  498. jump 60
  499. !
  500. @LABEL 59
  501. note "Connection Established." 2
  502. jump 60
  503. !
  504. ! Look for reliablilty and compression results 
  505. ! at the end of the connect result.
  506. !
  507. @LABEL 60
  508. matchclr
  509. matchstr  1 63 "LAPM"
  510. matchstr  2 63 "REL"
  511. matchstr  3 63 "ARQ"
  512. matchstr  4 68 "COMP/"
  513. matchstr  5 68 "COMP\13"
  514. matchstr  6 63 "V42/"
  515. matchstr  7 63 "V42\13"
  516. matchstr  8 68 "V42BIS"
  517. matchstr  9 68 "V42bis"
  518. matchstr 10 63 "MNP\13"
  519. matchstr 11 68 "MNP5"
  520. matchstr 12 70 "\10"
  521. matchread 30
  522. jump 70
  523.  
  524. ! -- Modem error correction link negotiation --
  525. ! Userhook 2 informs ARA that a modem-to-modem error
  526. ! correcting protocol has been negotiated
  527. !
  528. !
  529. @LABEL 62
  530. note "Modem Reliable Link Established." 2
  531. userhook 2
  532. jump 32
  533. !
  534. @LABEL 63
  535. note "Modem Reliable Link Established." 2
  536. userhook 2
  537. jump 60
  538. !
  539. ! -- Compression negotiation --
  540. ! Userhook 3 informs ARA that a modem-to-modem compression
  541. ! protocol has been negotiated
  542. !
  543. @LABEL 67
  544. note "Modem Compression Established." 2
  545. userhook 3
  546. jump 32
  547. !
  548. @LABEL 68
  549. note "Modem Compression Established." 2
  550. userhook 3
  551. jump 60
  552. !
  553. !
  554. ! -- Normal exit after "CONNECT" --
  555. !
  556. !  This modem has been setup to do CTS handshaking,
  557. !  and we assume that a CTS handshaking cable is being used.
  558. !
  559. @LABEL 70
  560. ! Turn on CTS handshaking.
  561. HSReset 0 1 0 0 0 0
  562. !
  563. ifANSWER 71
  564. pause 30
  565. @LABEL 71
  566. exit 0
  567. !
  568. !
  569. ! ---- Answer calls ----
  570. !
  571. !    A RING result from the modem and in ANSWERING mode
  572. !    claims the serial port and answering the phone
  573. !
  574. @LABEL 81
  575. ifORIGINATE 32
  576. userhook 1
  577. note "Answering phone..." 2
  578. write "ATA\13"
  579. jump 32
  580. !
  581. !
  582. ! ---- Hang up and reset modem ----
  583. !
  584. @HANGUP
  585. @LABEL 90
  586. settries 0
  587. HSReset 0 0 0 0 0 0
  588. !
  589. @LABEL 92
  590. !  Escape from data to command mode
  591. matchclr
  592. matchstr 1 96 "OK\13\10"
  593. write "+++"
  594. matchread 20
  595. !
  596. @LABEL 94
  597. ! Force a hangup
  598. matchclr
  599. matchstr 1 98 "NO CARRIER\13\10"
  600. matchstr 2 98 "OK\13\10"
  601. matchstr 3 98 "ERROR\13\10"
  602. matchstr 4 98 "0\13\10"
  603. write "ATH\13"
  604. matchread 30
  605. ! Try to get control of the modem by toggling DTR
  606. DTRClear
  607. pause 5
  608. DTRSet
  609. flush
  610. !
  611. ! Try the hangup sequence three times otherwise declare and error
  612. inctries
  613. iftries 3 101
  614. jump 92
  615. !
  616. @LABEL 96
  617. ! Pause between data and command mode
  618. pause 50
  619. jump 94
  620. !
  621. !
  622. @LABEL 98
  623. ! Recall the factory settings
  624. pause 15
  625. matchclr
  626. matchstr 1 99 "OK\13\10"
  627. write "AT&F1\13"
  628. matchread 30
  629. jump 101
  630. !
  631. @LABEL 99
  632. exit 0
  633. !
  634. ! ---- Error messages -----
  635. !
  636. ! Modem Not Responding
  637. @LABEL 101
  638. exit -6019
  639. !
  640. ! No Dial Tone
  641. @LABEL 102
  642. exit -6020
  643. !
  644. ! No Carrier or Error
  645. @LABEL 103
  646. exit -6021
  647. !
  648. ! Busy
  649. @LABEL 104
  650. exit -6022
  651. !
  652. ! No Answer
  653. @LABEL 105
  654. exit -6023
  655. !
  656. ! User Cancellation
  657. @LABEL 107
  658. exit -6008
  659.